package com.smartHome.mapper;

import com.smartHome.pojo.vo.EnergyConsumptionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface EnergyMapper {
    Double getHouseConsumption(@Param("houseId") Integer houseId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);

    Double getRoomConsumption(@Param("roomId") Integer roomId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);

    Double getDeviceConsumption(@Param("deviceId") Integer deviceId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);

    List<EnergyConsumptionVO.TrendData> getHouseTrend(@Param("houseId") Integer houseId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime,
            @Param("timeRange") Integer timeRange);

    List<String> getEnergySuggestions(@Param("houseId") Integer houseId);

    List<EnergyConsumptionVO.TrendData> getRoomTrend(@Param("roomId") Integer roomId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime,
            @Param("timeRange") Integer timeRange);

    List<EnergyConsumptionVO.TrendData> getDeviceTrend(@Param("deviceId") Integer deviceId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime,
            @Param("timeRange") Integer timeRange);
}